class GameMap extends AcGameObject {
    constructor(playground) {
        super();
        //游戏地图界面
        this.playground = playground;
        this.$canvas = $(`<canvas></canvas>`);
        this.ctx = this.$canvas[0].getContext('2d');
        this.ctx.canvas.width = this.playground.width;
        this.ctx.canvas.height = this.playground.height * 0.95;
        this.playground.$playground.append(this.$canvas);
        //技能栏界面
        this.$canvas2 = $(`<canvas></canvas>`);
        this.ctx2 = this.$canvas2[0].getContext('2d');
        this.ctx2.canvas.width = this.playground.width;
        this.ctx2.canvas.height = this.playground.height * 0.05; // 剩余高度的5%
        this.playground.$playground.append(this.$canvas2);
        //调整技能栏界面位置的css
        this.$canvas2.css({
            position: 'absolute',
            top: this.ctx.canvas.height + 'px',
            left: '0',
            width: this.playground.width + 'px',
            height: this.ctx2.canvas.height + 'px'
        });
    }

    start() {
    }

    update() {
        this.render();
    }

    render() {
        this.ctx.fillStyle = "rgba(0, 0, 0, 0.2)";
        this.ctx.fillRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);
        this.ctx2.fillStyle = "rgba(255, 255, 255, 0.2)";
        this.ctx2.fillRect(0, 0, this.ctx2.canvas.width, this.ctx2.canvas.height);
    }
}
